<template>
	<view class="mainbgc mainpadding" v-if="pageShow">
		<header-top :messageInfo="{typeFlag:true,message:'客户欠款详情',liner:false}"></header-top>
		<view class="mainpadding ffffff radius">
			<view class="dingdan flexleft" @click="phone(dataAll.staff.mobile)">
				经办人：{{dataAll.staff.username}}
				<view class="dizhiimg"></view>
			</view>
		</view>
		<!-- 地址信息 -->
		<view class="mainpadding ffffff margin_top radius flexbetween">
			<view class="">
				<view class="flexbetween">
					<view class="bigtext">{{dataAll.custom.name}}</view>
					<view class="bigtext normaltxt">{{dataAll.custom.mobile}}</view>
				</view>
				<view class="flexbetween biankuang">
					<view class="dizhi flexleft">
						<view class="xiankuan">
							地址：{{dataAll.custom.cityinfo}}{{dataAll.custom.address}}
						</view>
					</view>
				</view>
			</view>
			<view class="flexright">
				<view class="addressicon" style="margin-right: 20rpx;width: 80rpx;height: 80rpx;" @click="openmap()">
				</view>
				<view class="phoneicon" style="width: 80rpx;height: 80rpx;" @click="phone(dataAll.custom.mobile)"></view>
			</view>
		</view>
		<!-- 订单信息 -->
		<view class="mainpadding ffffff radius margin_top">
			<view class="dingdan shanpin">订单号：
				<text class="erbaxs">{{dataAll.order_no}}</text>
			</view>
			<!-- 10=微信支付,20=支付宝支付,30=银行卡支付,40=余额支付 -->
			<view class="dingdan shanpin margin_top">支付方式：
				<text class="erbaxs" style="color: #0BCB41;">{{dataAll.pay_type==10?'微信支付':dataAll.pay_type==20?'支付宝支付':dataAll.pay_type==30?'银行卡支付':dataAll.pay_type==50?'现金支付':'余额支付'}}</text>
			</view>
			<view class="dingdan shanpin margin_top">支付金额：
				<text class="erbaxs" style="color: #0BCB41;">￥{{dataAll.pay_price}}</text>
			</view>
			<view class="dingdan shanpin margin_top">优惠金额：
				<text class="erbaxs" style="color: #0BCB41;">￥{{dataAll.discount_price}}</text>
			</view>
			<view class="dingdan shanpin margin_top">备注：
				<text class="erbaxs">{{dataAll.notes}}</text>
			</view>
			<view class="dingdan shanpin margin_top">下单时间：
				<text class="erbaxs">{{dataAll.createtime_text}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {},
				httpRequest,
				pageShow:false,
				// 模态框
				modal: {
					modalShow: false,
					title: "",
				},
			}
		},
		onLoad(options) {
			this.listid = options.id
		},
		onShow() {
			this.init()
		},
		methods: {
			init() {
				let _this = this;
				httpRequest.request('/dhtapi/Customjs/detail', 'GET', {
					id: this.listid,
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			// 打开地图
			openmap() {
				uni.openLocation({
					latitude: Number(this.dataAll.custom.latitude), //即将传到高德或腾讯地图的终点纬度  必须是数值，字符串无效
					longitude: Number(this.dataAll.custom.longitude), //即将传到高德或腾讯地图的终点经度  必须是数值，字符串无效
					name: this.dataAll.custom.address, //即将传到高德或腾讯地图的店铺名称
					address: this.dataAll.custom.address, //即将传到高德或腾讯地图的详细地址
				})
			},
			phone(p) {
				uni.makePhoneCall({
					phoneNumber: p.toString()
				}).catch((e) => {
					// console.log(e)  //用catch(e)来捕获错误{makePhoneCall:fail cancel}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	
	.headerbottom {
		font-size: 28rpx;
		font-weight: bold;
	}

	.headerright {
		text-align: right;
	}

	.margin_topx {
		margin-top: 10rpx;
	}

	.huisetext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	.lansetext {
		font-size: 24rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #999999;
	}

	.dizhiimg {
		width: 24rpx;
		height: 24rpx;
		margin-left: 12rpx;
		// margin-top: 14rpx;
		background-size: 100% 100%;
		background-image: url('@/static/image/system/wyqlittlephone.png');
	}

	.content {
		padding-top: 30rpx;
	}

	.contentchild {
		font-size: 26rpx;
	}

	.content_child {
		margin: 20rpx 0;
	}

	.headerchild {
		font-size: 32rpx;
		font-weight: bold;
	}

	.headercenter {
		text-align: center;
	}

	.dingdan {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}

	.heji {
		font-size: 28rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #000000;
	}

	.shanpin {
		padding-bottom: 30rpx;
		border-bottom: 2rpx solid rgba(153, 153, 153, 0.05);
	}

	.erbaxs {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}

	.flex2 {
		flex: 2;
	}

	.flex1 {
		flex: 1.5;
		text-align: right;
	}

	.biankuang {
		margin-top: 10rpx;
	}

	.juli {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #0BBDCB;
	}

	.dizhi {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #737373;
	}

	.daifahuo {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #F3AD3D;
	}

	.yisongda {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #0BBDCB;
	}

	.bigtext {
		font-size: 32rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #000000;
	}

	.normaltxt {
		font-weight: 500;
	}

	.beizhu {
		color: #0BBDCB;
	}

	.xiankuan {
		width: 300rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
</style>